/*
 * ble_ll_ota.h
 *
 *  Created on: 2015-7-20
 *      Author: Administrator
 */

#ifndef BLE_LL_OTA_H_
#define BLE_LL_OTA_H_

#ifndef	BLE_OTA_ENABLE
#define BLE_OTA_ENABLE		0
#endif


#ifndef			NEW_FW_ADR
#define			NEW_FW_ADR			0x20000
#endif

#ifndef			OTA_FLG_ADR
#define			OTA_FLG_ADR			0x3f000
#endif

#define CMD_OTA_FW_VERSION					0xff00
#define CMD_OTA_START						0xff01
#define CMD_OTA_END							0xff02

typedef struct{
	u32 dma_len;            //won't be a fixed number as previous, should adjust with the mouse package number

	u8	type;				//RFU(3)_MD(1)_SN(1)_NESN(1)-LLID(2)
	u8  rf_len;				//LEN(5)_RFU(3)
	u16	l2cap;
	u16	chanid;

	u8	att;
	u8	hl;					// assigned by master
	u8	hh;					//

	u8	dat[23];

}rf_packet_att_data_t;


typedef void (*ota_startCb_t)(void);

extern void ble_setOtaStartCb(ota_startCb_t cb);
extern int otaWrite(void * p);
extern int otaRead(void * p);

#endif /* BLE_LL_OTA_H_ */
